/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package treeship.core.ship.space;

/**
 *
 * @author Moonchild
 */
public class Space {

    private double v;

    public double getValue() {
        return v;
    }

    public Space(double v) {
        this.v = v;
    }

    public Space plus(Space s) {
        return new Space(v + s.v);
    }

    public Space minus(Space s) {
        return new Space(v - s.v);
    }

    public boolean isSmallerThan(Space s) {
        if (v < s.v) {
            return true;
        }
        return false;
    }

    public boolean isBiggerThan(Space s) {
        if (v > s.v) {
            return true;
        }
        return false;
    }

    public boolean isSmallerOrEqualThan(Space s) {
        if (v <= s.v) {
            return true;
        }
        return false;
    }

    public boolean isBiggerOrEqualThan(Space s) {
        if (v >= s.v) {
            return true;
        }
        return false;
    }

    @Override
    public String toString() {
        return Math.round(v * 100) / 100.0 + "";
    }
}
